package com.rockcent.common.utils;

import org.apache.commons.lang3.time.DateFormatUtils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by DK on 16/10/18.
 *
 */
public class RDateFormatUtils extends DateFormatUtils {
    public static final String parsePattern = "yyyy-MM-dd HH:mm:ss";
    public static final String parseDatePattern = "yyyy-MM-dd";

    /**
     * 日期转字符串
     * @param date
     * @return
     */
    public static String format(Date date) {
        return DateFormatUtils.format(date, parsePattern);
    }

    /**
     * 日期转字符串
     * @param date
     * @return
     */
    public static String formatParseDatePattern(Date date) {
        return DateFormatUtils.format(date, parseDatePattern);
    }

}
